package com.lsmo.android.carfans.view.car;

import android.util.Log;
import android.widget.LinearLayout.LayoutParams;

import com.lsmo.android.util.DisplayMetricsData;

/**
 * 分辨率适配器
 * 
 * @author maxl
 * 
 */
public class ResolutionManager {

	private static final String TAG = "com.longshine.mobile";

	// 当前终端的分辨率
	private static int resolutionWidth, resolutionHeight;

	// 主界面布局
	private LayoutParams mainView_iconListLinearLayout_layoutParams;
	// 导航栏布局
	private LayoutParams navigationView_layoutParams;
	private int navigationView_paddingLeft, navigationView_paddingTop,
			navigationView_paddingRight, navigationView_paddingButtom;
	private LayoutParams navigationView_titleText_layoutLarams;
	private int navigationView_titleTextSize;
	private int navigationView_buttonTextSize;
	
//	// 图标显示布局
//	private int iconListView_columnWidth;
//	private int iconListView_verticalSpacing;
//	private int iconListView_horizontalSpacing;
//	private int iconListView_paddingLeft, iconListView_paddingTop,
//			iconListView_paddingRight, iconListView_paddingButtom;
//	private int iconListView_item_paddingLeft, iconListView_item_paddingTop,
//			iconListView_item_paddingRight, iconListView_item_paddingButtom;
//	private LayoutParams iconListView_image_layoutParams;
//	private int iconListView_item_textSize;
//	// 标签分类布局
//	private int tabBarView_columnWidth;
//	private int tabBarView_horizontalSpacing;
//	private int tabBarView_backgroundResource;
//	private int tabBarView_selector;
//	private int tabBarView_item_paddingLeft, tabBarView_item_paddingTop,
//			tabBarView_item_paddingRight, tabBarView_item_paddingButtom;
//	private int tabBarView_item_textSize;

	public ResolutionManager() {
		init();
	}

	public void init() {
		DisplayMetricsData mcsData = new DisplayMetricsData();
		resolutionWidth = mcsData.getDmWidth();
		resolutionHeight = mcsData.getDmHeight();

		Log.i(TAG, "resolutionWidth * resolutionHeight = " + resolutionWidth
				+ " * " + resolutionHeight);

		if (resolutionWidth == 480 && resolutionHeight == 854) {
			Log.i(TAG, "当前手机分辨率是：480 * 854");

			mainView_iconListLinearLayout_layoutParams = new LayoutParams(
					new LayoutParams(LayoutParams.FILL_PARENT, 690, 1));

			navigationView_layoutParams = new LayoutParams(new LayoutParams(
					LayoutParams.FILL_PARENT, 50));
			navigationView_paddingLeft = 10;
			navigationView_paddingTop = 0;
			navigationView_paddingRight = 10;
			navigationView_paddingButtom = 0;
			navigationView_titleText_layoutLarams = new LayoutParams(
					new LayoutParams(240, LayoutParams.WRAP_CONTENT));
			navigationView_titleTextSize = 18;
			navigationView_buttonTextSize = 18;

//			iconListView_item_textSize = 13;
//			iconListView_columnWidth = 100;
//			iconListView_verticalSpacing = 25;
//			iconListView_horizontalSpacing = 8;
//			iconListView_paddingLeft = 8;
//			iconListView_paddingTop = 25;
//			iconListView_paddingRight = 8;
//			iconListView_paddingButtom = 25;
//			iconListView_item_paddingLeft = 5;
//			iconListView_item_paddingTop = 5;
//			iconListView_item_paddingRight = 5;
//			iconListView_item_paddingButtom = 5;
//			iconListView_image_layoutParams = new LayoutParams(
//					new LayoutParams(LayoutParams.FILL_PARENT, 110));
//
//			tabBarView_item_paddingLeft = 0;
//			tabBarView_item_paddingTop = 6;
//			tabBarView_item_paddingRight = 0;
//			tabBarView_item_paddingButtom = 6;
//			tabBarView_item_textSize = 12;
//
//			tabBarView_columnWidth = 90;
//			tabBarView_horizontalSpacing = 1;
//			tabBarView_backgroundResource = R.drawable.menu_bg;
//			tabBarView_selector = R.drawable.grid_menu_selectors_trans;
		}

		if (resolutionWidth == 480 && resolutionHeight == 800) {
			Log.i(TAG, "当前手机分辨率是：480 * 800");
			mainView_iconListLinearLayout_layoutParams = new LayoutParams(
					new LayoutParams(LayoutParams.FILL_PARENT, 640, 1));

			navigationView_layoutParams = new LayoutParams(new LayoutParams(
					LayoutParams.FILL_PARENT, 50));
			navigationView_paddingLeft = 0;
			navigationView_paddingTop = 0;
			navigationView_paddingRight = 0;
			navigationView_paddingButtom = 0;
			navigationView_titleText_layoutLarams = new LayoutParams(
					new LayoutParams(240, LayoutParams.WRAP_CONTENT));
			navigationView_titleTextSize = 14;
			navigationView_buttonTextSize = 14;

//			iconListView_item_textSize = 13;
//			iconListView_columnWidth = 100;
//			iconListView_verticalSpacing = 10;
//			iconListView_horizontalSpacing = 6;
//			iconListView_paddingLeft = 5;
//			iconListView_paddingTop = 5;
//			iconListView_paddingRight = 5;
//			iconListView_paddingButtom = 5;
//			iconListView_item_paddingLeft = 8;
//			iconListView_item_paddingTop = 8;
//			iconListView_item_paddingRight = 8;
//			iconListView_item_paddingButtom = 8;
//			iconListView_image_layoutParams = new LayoutParams(
//					new LayoutParams(LayoutParams.FILL_PARENT, 110));
//
//			tabBarView_item_paddingLeft = 0;
//			tabBarView_item_paddingTop = 6;
//			tabBarView_item_paddingRight = 0;
//			tabBarView_item_paddingButtom = 6;
//			tabBarView_item_textSize = 12;
//
//			tabBarView_columnWidth = 90;
//			tabBarView_horizontalSpacing = 1;
//			tabBarView_backgroundResource = R.drawable.menu_bg;
//			tabBarView_selector = R.drawable.grid_menu_selectors_trans;
		}

		if (resolutionWidth == 320 && resolutionHeight == 480) {
			Log.i(TAG, "当前手机分辨率是：320 * 480");
			mainView_iconListLinearLayout_layoutParams = new LayoutParams(
					new LayoutParams(LayoutParams.FILL_PARENT, 375, 1));

			navigationView_layoutParams = new LayoutParams(new LayoutParams(
					LayoutParams.FILL_PARENT, 40));
			navigationView_paddingLeft = 2;
			navigationView_paddingTop = 0;
			navigationView_paddingRight = 2;
			navigationView_paddingButtom = 0;
			navigationView_titleText_layoutLarams = new LayoutParams(
					new LayoutParams(150, LayoutParams.WRAP_CONTENT));
			navigationView_titleTextSize = 14;
			navigationView_buttonTextSize = 14;

//			iconListView_item_textSize = 10;
//			iconListView_columnWidth = 60;
//			iconListView_verticalSpacing = 2;
//			iconListView_horizontalSpacing = 4;
//			iconListView_paddingLeft = 4;
//			iconListView_paddingTop = 2;
//			iconListView_paddingRight = 4;
//			iconListView_paddingButtom = 2;
//			iconListView_item_paddingLeft = 5;
//			iconListView_item_paddingTop = 5;
//			iconListView_item_paddingRight = 5;
//			iconListView_item_paddingButtom = 5;
//			iconListView_image_layoutParams = new LayoutParams(
//					new LayoutParams(LayoutParams.FILL_PARENT, 100));
//
//			tabBarView_item_paddingLeft = 0;
//			tabBarView_item_paddingTop = 6;
//			tabBarView_item_paddingRight = 0;
//			tabBarView_item_paddingButtom = 6;
//			tabBarView_item_textSize = 10;
//
//			tabBarView_columnWidth = 90;
//			tabBarView_horizontalSpacing = 1;
//			tabBarView_backgroundResource = R.drawable.menu_bg;
//			tabBarView_selector = R.drawable.grid_menu_selectors_trans;
		}
	}

	public LayoutParams getMainView_iconListLinearLayout_layoutParams() {
		return mainView_iconListLinearLayout_layoutParams;
	}

	public LayoutParams getNavigationView_layoutParams() {
		return navigationView_layoutParams;
	}

	public int getNavigationView_paddingLeft() {
		return navigationView_paddingLeft;
	}

	public int getNavigationView_paddingTop() {
		return navigationView_paddingTop;
	}

	public int getNavigationView_paddingRight() {
		return navigationView_paddingRight;
	}

	public int getNavigationView_paddingButtom() {
		return navigationView_paddingButtom;
	}

	public LayoutParams getNavigationView_titleText_layoutLarams() {
		return navigationView_titleText_layoutLarams;
	}

	public int getNavigationView_titleTextSize() {
		return navigationView_titleTextSize;
	}

	public int getNavigationView_buttonTextSize() {
		return navigationView_buttonTextSize;
	}

//	public int getIconListView_columnWidth() {
//		return iconListView_columnWidth;
//	}
//
//	public int getIconListView_paddingLeft() {
//		return iconListView_paddingLeft;
//	}
//
//	public int getIconListView_paddingTop() {
//		return iconListView_paddingTop;
//	}
//
//	public int getIconListView_paddingRight() {
//		return iconListView_paddingRight;
//	}
//
//	public int getIconListView_paddingButtom() {
//		return iconListView_paddingButtom;
//	}
//
//	public int getIconListView_verticalSpacing() {
//		return iconListView_verticalSpacing;
//	}
//
//	public int getIconListView_horizontalSpacing() {
//		return iconListView_horizontalSpacing;
//	}
//
//	public int getTabBarView_item_textSize() {
//		return tabBarView_item_textSize;
//	}
//
//	public int getTabBarView_item_paddingLeft() {
//		return tabBarView_item_paddingLeft;
//	}
//
//	public int getTabBarView_item_paddingTop() {
//		return tabBarView_item_paddingTop;
//	}
//
//	public int getTabBarView_item_paddingRight() {
//		return tabBarView_item_paddingRight;
//	}
//
//	public int getTabBarView_item_paddingButtom() {
//		return tabBarView_item_paddingButtom;
//	}
//
//	public int getIconListView_item_paddingLeft() {
//		return iconListView_item_paddingLeft;
//	}
//
//	public int getIconListView_item_paddingTop() {
//		return iconListView_item_paddingTop;
//	}
//
//	public int getIconListView_item_paddingRight() {
//		return iconListView_item_paddingRight;
//	}
//
//	public int getIconListView_item_paddingButtom() {
//		return iconListView_item_paddingButtom;
//	}
//
//	public LayoutParams getIconListView_image_layoutParams() {
//		return iconListView_image_layoutParams;
//	}
//
//	public int getTabBarView_columnWidth() {
//		return tabBarView_columnWidth;
//	}
//
//	public int getTabBarView_horizontalSpacing() {
//		return tabBarView_horizontalSpacing;
//	}
//
//	public int getTabBarView_backgroundResource() {
//		return tabBarView_backgroundResource;
//	}
//
//	public int getTabBarView_selector() {
//		return tabBarView_selector;
//	}
//
//	public int getIconListView_item_textSize() {
//		return iconListView_item_textSize;
//	}
}